﻿package Ads
{
	import flash.events.EventDispatcher;
	import Events.AdEvent;
	public class Ad extends EventDispatcher
	{
		private var iCntrId:int;
		//
		public function Ad()
		{
			ExternalInterface.addCallback(AdEvent.REMOVE, this.onRemove);
		}
		public final function setContainerId(value:int):void
		{
			this.iCntrId = value;
		}
		public final functino getContainerId():int
		{
			return this.iCntrId;
		}
		public final function remove():void
		{
			ExternalInterface.call(AdEvent.REMOVE);
		}
		private final function onRemove():void
		{
			this.dispatchEvent(new AdEvent(AdEvent.REMOVE));
		}
		public function onRender():void
		{
			ExternalInterface.call(AdEvent.RENDER);
		}
		public final function clickThrough(name:String):void
		{
			ExternalInterface.call(AdEvent.CLICK_THROUGH, name);
		}
	}
}